package com.xuebang.admin.web;

public class Table {

	private int page = 1;//page #
	private String sort = null;//sorting field
	private String dir = "asc"; //sorting direction

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		if (page < 1) {
			page = 1;
		}
		this.page = page;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getDir() {
		return dir;
	}

	public void setDir(String dir) {
		this.dir = dir;
	}
	
	public String getOrderBy(){
		String orderBy = null;
		if(this.getSort()!=null){
			orderBy = this.getSort()+" "+this.getDir();
		}
		return orderBy;
	}

}
